<template>
	<view class="page">
		<view class="head">
			<view class="job-personal-info">
				<view class="job-personal-info-avatar">
					<u-avatar :src="$getImgUrl(personaInfo.TXImg)" size="93rpx"></u-avatar>
					<image class="job-personal-info-avatar-sex" :src="personaInfo.Sex == '男'? '/static/job/man.png':'/static/job/w.png'"></image>
				</view>
				<view class="job-personal-info-content">
					<view class="job-personal-info-title">{{ personaInfo.Name}} ({{ personaInfo.RealName }})</view>
					<view class="job-personal-info-tag">
						<view class="job-personal-info-tag-item">
							<u-tag :text="personaInfo.Age + '岁'" bgColor="#f7d9da" color="#c8000a" size="mini" type="warning"></u-tag>
						</view>
						<view class="job-personal-info-tag-item">
							<u-tag :text="personaInfo.HunYin" bgColor="#f7d9da" color="#c8000a" size="mini" type="warning"></u-tag>
						</view>
						<view class="job-personal-info-tag-item">
							<u-tag :text="personaInfo.XueLi" bgColor="#f7d9da" color="#c8000a" size="mini" type="warning"></u-tag>
						</view>
					</view>
				</view>
			</view>
			
			<view class="job-personal-statistics">
				<view class="job-personal-statistics-item">
					<view class="job-personal-statistics-item-text">简历更新时间</view>
					<view class="job-personal-statistics-item-number">{{$u.timeFormat(personaInfo.ShiJian, 'mm-dd')}}</view>
				</view>
				<u-line color="#cbbda5" direction="col" :hairline="false" length="100%"></u-line>
				<view class="job-personal-statistics-item">
					<view class="job-personal-statistics-item-text">近期投递职位</view>
					<view class="job-personal-statistics-item-number">{{personaInfo.TouDiNum}}个</view>
				</view>
				<u-line color="#cbbda5" direction="col" :hairline="false" length="100%"></u-line>
				<view class="job-personal-statistics-item">
					<view class="job-personal-statistics-item-text">浏览量</view>
					<view class="job-personal-statistics-item-number">{{ personaInfo.Hits }}次</view>
				</view>
			</view>
			
		</view>
		<u-gap height="5" bgColor="#f5f5f5"></u-gap>
		<view class="body">
			
			<view class="job-personal-resume">
				<view class="job-personal-resume-title">
					求职意向
				</view>
				<u-gap height="2" bgColor="#f5f5f5"></u-gap>
				<view class="job-personal-resume-content">
					
					<view class="job-personal-resume-content-item">
						<view class="job-personal-resume-content-item-title">
							期望薪资：
						</view>
						<view class="job-personal-resume-content-item-content" style="color: #c8000a;">
							{{ personaInfo.XzName}}元
						</view>
					</view>
					
					<view class="job-personal-resume-content-item">
						<view class="job-personal-resume-content-item-title">
							工作经验：
						</view>
						<view class="job-personal-resume-content-item-content">
							{{ personaInfo.Gzjy }}
						</view>
					</view>
					
					<view class="job-personal-resume-content-item">
						<view class="job-personal-resume-content-item-title">
							求职职位：
						</view>
						<view class="job-personal-resume-content-item-content">
							{{ personaInfo.ZhiWei }}
						</view>
					</view>
					
					<view class="job-personal-resume-content-item">
						<view class="job-personal-resume-content-item-title">
							求职状态：
						</view>
						<view class="job-personal-resume-content-item-content">
							{{ personaInfo.Qzzt }}
						</view>
					</view>
					
					<view class="job-personal-resume-content-item">
						<view class="job-personal-resume-content-item-title">
							求职区域：
						</view>
						<view class="job-personal-resume-content-item-content">
							{{ personaInfo.Diqu}}
						</view>
					</view>
					
				</view>
			</view>
			<u-gap height="5" bgColor="#f5f5f5"></u-gap>
			
			<view class="job-personal-resume">
				<view class="job-personal-resume-title">
					工作经历
				</view>
				<u-gap height="2" bgColor="#f5f5f5"></u-gap>
				<view class="job-personal-resume-content">
					<u-parse :content="personaInfo.WorkJL"></u-parse>
				</view>
			</view>
			<u-gap height="5" bgColor="#f5f5f5"></u-gap>
			
			<view class="job-personal-resume">
				<view class="job-personal-resume-title">
					教育经历
				</view>
				<u-gap height="2" bgColor="#f5f5f5"></u-gap>
				<view class="job-personal-resume-content">
					<u-parse :content="personaInfo.JyJL"></u-parse>
				</view>
			</view>
			<u-gap height="5" bgColor="#f5f5f5"></u-gap>
			
			<view class="job-personal-resume">
				<view class="job-personal-resume-title">
					自我描述
				</view>
				<u-gap height="2" bgColor="#f5f5f5"></u-gap>
				<view class="job-personal-resume-content">
					<u-parse :content="personaInfo.Zwms"></u-parse>
				</view>
			</view>
			<u-gap height="5" bgColor="#f5f5f5"></u-gap>
			
		</view>
		<view class="bottom">
			<!-- 对话框开始 -->
			<u-overlay :show="isViewResume" @click="isViewResume = false">
				<view class="job-dialog">
					<view class="job-dialog-content">您确定查看联系电话？</view>
					<view class="job-dialog-buttom">
						<view class="job-dialog-buttom-confirm" @click="isContinue = false"  @tap.stop>
							继续查看
						</view>
						<view class="job-dialog-buttom-cancel">
							认证企业赠送查看次数
						</view>
					</view>
				</view>
			</u-overlay>
			<!-- 对话框结束 -->
		</view>
		<!-- 底部导航菜单开始 -->
		<view class="job-personal-float-tabbar u-safe-bottom u-safe-area-inset-bottom">
			<view class="job-personal-float-tabbar-home">
				<u-icon name="home-fill" color="#c8000a" size="24px" label="首页" labelPos="bottom" labelSize="11px" labelColor="#333333" space="2px"></u-icon>
			</view>
			<u-line color="#e3e3e3" direction="col" :hairline="false" length="100%"></u-line>
			<view class="job-personal-float-tabbar-favorite" @click="getJobPersonalCollection()">
				<u-icon :name="isCollection == 0? 'star' : 'star-fill'" color="#c8000a" size="24px" label="收藏" labelPos="bottom" labelSize="11px" labelColor="#333333" space="2px"></u-icon>
			</view>
			<view class="job-personal-float-tabbar-phone" @click="isViewResume = true">
				<u-icon name="/static/job/home3.png" size="30rpx" label="查看联系电话" labelPos="right" labelSize="26rpx" labelColor="#ffffff" space="10rpx" v-if="isContinue"></u-icon>
				<u-icon name="/static/job/home3.png" size="30rpx" label="拨打电话" labelPos="right" labelSize="26rpx" labelColor="#ffffff" space="10rpx" v-else></u-icon>
			</view>
		</view>
		<!-- 底部导航菜单结束 -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				personalId: 0, // 用户建立ID
				isViewResume: false, // 是否显示查看电话
				isContinue: true, // 切换电话显示和拨打电话
				isCollection: 0, // 收藏状态
				personaInfo: {
					TXImg: '',
					Sex: '',
					Name: '',
					RealName: '',
					Age: '',
					HunYin: '',
					XueLi: '',
					ShiJian: '',
					TouDiNum: '',
					Hits: '',
					XzName: '',
					Gzjy: '',
					ZhiWei: '',
					Qzzt: '',
					Diqu: '',
					WorkJL: '',
					JyJL: '',
					Zwms: '',
					isCollection: 0,
				}, // 简历信息
				workContent: "薪资：5000-6000<br>本人驾龄5年，为人正直能干，肯吃苦。",
				educationContent: "重庆信息学院",
				selfContent: "能吃苦耐劳"
			}
		},
		async onLoad(opeion) {
			this.personalId = opeion.ID
			console.log(this.personalId)
			await this.getJobPersonalShow()
			
		},
		methods: {
			getJobPersonalShow() {
				this.$api.getJobPersonalShow({openid: getApp().globalData.openid,ID: this.personalId}).then(res => {
					console.log(res.data)
					this.personaInfo = res.data
					this.isCollection = this.personaInfo.IsSC
				})
			},
			getJobPersonalCollection() {
				this.$api.getJobPersonalCollection({openid: getApp().globalData.openid,ID: this.personalId}).then(res => {
					// console.log(res.status)
					this.isCollection = res.status
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
@import url('jobPersonal.css');
</style>
